﻿Ext.define('DrinkOrder', {
    extend: 'Ext.data.Model',
    fields: [
        { name: 'ID', type: 'int' },
        { name: 'TableOrderID', type: 'int' },
        { name: 'Name', type: 'string' },
        { name: 'Quantity', type: 'int' },
        { name: 'TotalQuantity', type: 'int' },
        { name: 'AmountDue', type: 'float' }
     
    ]
});




function drinkOrderTotalRenderer(value, metadata, record, rowIndex, colIndex, store) {
    if (record.data.AmountDue == 0)
        return '<span class="gridBold">' + value + '</span>';
    else
        return value;
}

function drinkOrderAmountDueRenderer(value, metadata, record, rowIndex, colIndex, store) {
    if (record.data.AmountDue == 0)
        return formatCurrencyRenderer(value);
    else
        return '<span class="gridBold">' + formatCurrencyRenderer(value) + '</span>';
}